Masthead

Terrain Analysis - Creating a Safe Haven after a Zombie Apocalypse

Introduction

The Zombie apocalypse has finally come! You've been living in a cave in the mountains for over a year and you've run out of food. Now you'll need a location where you can grow food and keep an eye out for roving herds of the undead. Much of Humboldt County was bombed trying to stop the zombies and the resulting fires burned everything to the ground. Fortunately, you had your laptop with you and had installed ArcGIS Pro on it before the apocalypse so you can use GIS to select the perfect spot for your new homestead! You'll need to find the largest area of south-facing land with a low slope.

Learning Outcomes

Overview

For this lab, we'll be done a series of steps, including a number of topographic transforms to find the optimal location for our safe haven.

  1. Mosaic two DEMs to get a single DEM for all of Humboldt County
  2. Project the DEM to UTM
  3. Create a slope raster
  4. Use raster calculator to find the slopes that are gently sloping
  5. Create an aspect raster.
  6. Use find aspects that are south facing
  7. Multiply the rasters together to find the areas that have gentle slopes and are south-facing
  8. Create a hillshade to see if the model worked.
  9. Convert the areas to polygons.
  10. Compute the area of all the polygons.
  11. Find the largest area as our potential site.
  12. Create a viewshed to check and see if we can see zombies coming from a distance.

Data

For this lab, use the DEMs we used for the Arcata Forest lab. However, you'll want to go back to the originals as we will be doing analysis across a large part of Humboldt County.

Walk Through: Workspace Preparation

  1. Set up your workspace/folder structure. Remember the file and folder name restrictions we warned you about in previous labs.
  2. Move the original DEMs into your originals folder.

Skill Drill 2: Creating a Mosaic

Please see this video for details on executing the steps below in ArcGIS Pro.

  1. Load the rasters into ArcGIS Pro.
  2. Check the pixel depth and spatial reference for the DEMs.
  3. Mosaic the two rasters into a new raster. Make sure to keep the pixel type as 32-bit floating point and the number of bands is 1.
    1. We need to keep the same spatial reference at this point because the Mosaic to New Raster tool does not allow us to specify the type of resampling (nearest neighbor, bilinear, cubic).
  4. Project the raster into WGS84, UTM Zone 10 North. Make sure to use bilinear or cubic for the sampling method.
  5. At this point, you can clip in ArcGIS the raster to just Humboldt county. This will make the processing go faster. You can also wait until you produce your final datasets and then crop them to Humboldt county for your final maps.

Walk Through: Creating a Slope Raster

Before going on, you'll want to check the units for the elevation values in the DEM. If they are not set to meters, you'll need to convert them or compute Z values. The problem is that the units are often missing from the metadata. You might need to check the documentation with the data set, the web site, or figure it out by looking at a topography map for the area you are working in and comparing the values on the topo to the DEM.

  1. Run the Slope tool in the toolbox
  2. Make sure you are using the correct DEM for the input.
  3. Give the output raster a good name like "Slope.img"
  4. Make sure the output will be in degrees.
  5. Set the Z factor if needed and run the tool.
  6. When done, zoom in an checkout how the slopes look.
  7. Next, use Raster Calculator for find the slope values that are greater than 1 and less than 5. This way our new homestead will have some drainage but will not be too steep for houses. Not that "greater than" is different from "greater than or equal" and this can impact the result.

In Raster Calculator, "AND" operations are specified with the ampersand character ("&"). The "OR" operation is designated with a vertical "pipe" ("¦"). Also, parenthesis are important!

  1. When displayed in the data frame, areas where there slope is too steep will appear whatever color is assigned to the value 0, while areas where the slope is ideal for a homestead property will appear whatever color is assigned to the value 1.

Walk Through: Creating an Aspect Raster

The next step is to create an "aspect" raster. The "aspect" is the direction a slope is facing. People, and some plants, like to live on the south-facing slopes in northern latitudes because there is more exposure to the sun.

  1. Run the Aspect tool.
  2. Make sure you are using the correct DEM for the input raster.
  3. Save the "Output" raster in your working folder and name it "Aspect.img"
  4. Take a look at the values in the legend on the map. ArcGIS finds aspect for each pixel in one of eight cardinal directions. These are colorized in 45 degree slices where 0 degrees is a north-facing slope (actually from 337.5 degrees to 22.5), 22.5 to 67.5 is a northeast facing slope, and so on going clockwise. Flat areas are set to -1 to show they do not have an aspect (i.e. they don't point in any direction). If you want to see the actual values, change the symbology to "Stretch".

If you want to visualize aspect with arrows that point "downhill" you'll need to use another GIS package, such as BlueSpray.

  1. Use Raster Calculator to create a raster with 1s where the aspect is generally south-facing, or between 135 and 225 degrees.

Note: You can perform the same function with the "Reclass" tool in ArcGIS but your results may vary because the tool does not allow you to specify what happens with integer values.

Pan around the map a bit and you'll notice some strange patterns just to the north of Arcata Bay. These are caused by not having enough precision in our DEM. If we were going to work in the flat lands, we would need a higher precision DEM.

Walk Through: Creating a Simple Model

You can now create a simple, initial model for your homestead/property by either using the "AND" function or by multiplying them together.

If your rasters are both just 0s and 1s, you can multiply them together and get exactly the same result as you would using the "AND" operator. Desirable cells will have a value of 1, and undesirable cells will have a value of 0.

  1. Use Raster Calculator to multiply the south-facing raster and the gentle slope raster together.
  2. Take a look at the result and compare it with your original slope and aspect rasters.

Walk Through: Creating a Hillshade

  1. Create a hillshade from your DEM and compare it to your model to see if it makes sense.

Hillshades are rarely used in analysis, but are commonly used in producing maps, as they give us a better "feel" for what is happening with the terrain than a DEM, slope, or aspect raster.

Walk Through: Raster to Polygon

You should now have a raster of your simple model results, where suitable land is represented by a 1, and unsuitable land is represented by a 0. The analysis we want to do next requires we convert our potential suitable site areas into polygons.

Note that the "Raster to Polygon" tool, for some unknown reason, will fail if your file paths have any spaces in them. You'll want to replace the spaces with underscores ("_") before running the tool. In general, it is a bad idea to include any punctuation other than underscores in any folder or file names when working with GIS software.

  1. We no longer care about cells with a value of 0, so let's remove them. Use the Reclassify tool to reclassify all 0 values to "No Data". Remember you need to change the "new values", not "old values"
  2. Run the Raster to Polygon on your model results.
  3. Select your simple model as the "Input Raster"
  4. The "Field" value should only have one entry "Value" so just select this entry.

If you follow a different set of steps for the processing, you may need to select a different entry than "Value". This value will be inserted as the value for each raster pixel in the output so select the "Field" that will allow you to process the raster in the way you desire.

  1. Set the "Output" to your working folder and name it "PotentialSites.shp"
  2. Make sure the "Simplify Polygons" checkbox is unchecked. This will make the polygons follow the edges of the raster which is a more accurate representation of the data in the raster (i.e. you're not losing any information). If you're using the polygons for visualization, you will probably want to check "Simplify Polygons" because it will look better.
  3. Click "OK" and you should see a polygon feature layer appear.

Now we will select the best possible site for your new homestead.

  1. Add an attribute for the area of each polygon, make sure to pick the best Data Type for this.
  2. Sort the values to find the polygon with the largest area.
  3. Right-click in the far left column in the attribute table on the row for the largest area to "Zoom to" that polygon.
  4. Select the feature with the largest area. This will be our homestead.
    1. Export the selected polygon with the largest area and save it to your working folder as a shapefile. Call it "homestead.shp".
    2. Remove any unnecessary layers from your table of contents.
    3. Don't forget to clear your selection.

Walk Through: Creating a Viewshed

A viewshed shows the area of land that can be viewed from a specific location. We'll want to select one potential site and then convert it to a point for the viewshed tool.

  1. Run the Feature to Point tool.
  2. Select your homestead shapefile as the input
  3. Make sure "Inside" is checked so you have a point within a shape
  4. Give the output a good name such as "LookoutTower.shp" and save it your working folder
  5. Run the Viewshed tool
  6. Select your original DEM as the input raster
  7. Select your new (point) homestead layer for the "Input points...features"
  8. Give the "Output Raster" a good name like "Viewshed.img" and save it to your working folder
  9. Click "OK"
  10. The resulting raster will show you the pixels in the raster that can theoretically be seen from your site points. Take a look at the result.

Your point may be on the top of a hill, or flat area which limits what is "visible." This is because the viewshed tool in ArcGIS assumes that you are looking from ground level (i.e. like you're buried up to your eyes at the site point). Also note that the main help page for the viewshed tool does not mention how to fix this! There is another page that does describe how to set the observer height.

  1. Add an attribute to your "LookoutTower.shp" shapefile named "OFFSETA." This field has to be exactly this name (this is unusual in ArcGIS but check the help for more information). Set the "Type" to "Double."
  2. Set this value to 30 to indicate you want to see what the view is like from 30 meters above ground level. Try different values to find out how high a tower will need to be built to see zombies at a distance you feel comfortable with.
  3. Open the View shed tool again. This time, ArcGIS should find the "OFFSETA" value and your view shed should be larger. You may have to change the OFFSETA value to find the optimal height for your tower so you can see the zombies coming!

© Copyright 2018 HSU - All rights reserved.